Debugging of counterexamples in formal verification

ABSTRACT

The result of a property based formal verification analysis of a circuit design may include at least one counterexample for each property that is violated, which a user can use to debug the circuit design. To assist the user in this debugging process, a debugging tool displays the counterexample trace annotated in such a way to illustrate where the property violation occurs and what parts of this trace contributes to the property violation. The debugging tool thus facilitates understanding of what parts of the counterexample trace are responsible for the property failure. The user can then select any of those contributing points as a starting point for further debugging.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No. 60/944,221, filed Jun. 15, 2007, which is incorporated by reference in its entirety.

BACKGROUND

This invention relates generally to formal verification of circuit designs, and more particularly to debugging counterexamples found in formal verification.

As the complexity in circuit design has increased, there has been a corresponding improvement in various kinds of verification and debugging techniques. In fact, these verification and debugging techniques have evolved from relatively simple transistor circuit-level simulation (in the early 1970s) to logic gate-level simulation (in the late 1980s) to the current art that uses Register Transfer Language (RTL)-level simulation, and formal verification. RTL describes the registers of a computer or digital electronic system and the way in which data are transferred among the combinational logic between registers.

Existing verification and debugging tools are used in the design flow of a circuit. The design flow begins with the creation of a circuit design at the RTL level using RTL source code. The RTL source code is specified according to a Hardware Description Language (HDL), such as Verilog HDL or VHDL. Circuit designers use high-level hardware description languages because of the size and complexity of modern integrated circuits. Circuit designs are developed in a high-level language using computer-implemented software applications, which enable a user to use text-editing and graphical tools to create a HDL-based design. An increasingly popular technique is to use formal methods to verify the properties of a design completely. Formal methods use mathematical techniques to prove that a design property is either always true or to provide an example condition (called a counterexample) that demonstrates the property is false. Tools that use formal methods to verify RTL source code and design properties are known as “model checkers.” Design properties to be verified include specifications and/or requirements that must be satisfied by the circuit design. The formal verification technology requires that the requirements are expressed in a formal notation, for example a temporal language, which enables an exhaustive mathematical check whether a design complies with the requirements.

Although a counterexample demonstrates an example condition under which a circuit design fails a property, the cause of the failure is not always obvious. Accordingly, what are needed are techniques to view and analyze the results of formal verification of a circuit design (such as a counterexample) to help circuit designers understand the results obtained from the formal verification (e.g., why a particular property failed).

SUMMARY

The result of a property based formal verification analysis of a circuit design may include at least one counterexample for each property that is violated, which a user can use to debug the circuit design. To assist the user in this debugging process, embodiments of the invention include a debugging tool that displays the counterexample trace annotated in such a way to illustrate where the property violation occurs and what parts of this trace contributes to the property violation. In this way, the debugging tool facilitates understanding of what parts of the counterexample trace are responsible for the property failure. The user can then select any of those contributing points as a starting point for further debugging.

Embodiments of the invention include a debugging tool that helps the circuit designer better understand counterexamples, and thereby more easily debug the circuit design when counterexamples are found. In one embodiment, for a counterexample identified during the formal verification process, the debugging tool selects a set of explanatory points for the violated property. The set of explanatory points illustrates what parts of the counterexample directly contribute to the violation of the property. Rather than merely presenting a trace for the counterexample, the debugging tool may thus present the circuit designer with the trace showing the counterexample along with the explanatory points.

The debugging tool may also present additional information that might help the designer understand the nature of how the counterexample violates the property. This additional information may comprise, for example, annotations, markings, coloring, and/or other indicia or formatting on the trace that illustrates the counterexample. The information may also comprise selected portions of the circuit design code that is related to the counterexample trace, with any coloring or formatting that may assist in the understanding of the counterexample.

In other embodiments, the debugging tool need not be limited to analysis of counterexamples obtained from formal verification. For example, embodiments of the techniques described herein may be used to highlight traces that are produced in a simulation of a circuit design, provided that a property fails on such a trace. Accordingly, the invention need not be restricted to formal verification.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of a verification methodology in accordance with an embodiment of the invention.

FIG. 2 is a flow chart of an operation of a debugging tool, in accordance with an embodiment of the invention.

FIGS. 3 through 15 are example traces, which may be displayed by embodiments of the debugging tool.

The figures depict various embodiments of the present invention for purposes of illustration only. One skilled in the art will readily recognize from the following discussion that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the invention described herein.

DETAILED DESCRIPTION

Tool Flow and Methodology for Formal Verification

FIG. 1 illustrates an embodiment of a methodology for formal verification of a circuit design 20. The circuit design 20 may be embodied in a data file encoded using a hardware description language (HDL), which may describe the structural design and operation of a circuit. A set of requirements is derived from a design specification for the circuit and then used to test whether the circuit design is compliant with the design specification. A user, such as a circuit designer or a verification engineer, may supply the requirements for the circuit design. The requirements may be encoded in a verification specification 30 as one or more properties for the circuit design 20, encoded for example using Property Specification Language (PSL) or SystemVerilog Assertion (SVA). The verification specification 30 may be directly coded by a user or captured in an automated process. A property may be represented in the verification specification 30 as an assertion, where the assertion is satisfied if the property is true for all operating conditions of the circuit design 20. A property may also be represented in the verification specification 30 as a cover, where the cover is satisfied if the property is true for some operating condition of the circuit design 20.

In a formal verification process, the verification tool 100 receives a circuit design 20 and a verification specification 30 for testing the circuit design 20 against a set of requirements. The circuit design 20 and verification specification 30 may be represented in one or more files containing HDL code, which define a digital design and/or properties that give a functional specification of the design. The verification tool 100 may convert the inputs (i.e., the circuit design 20 and verification specification 30) into an internal representation using one or more data structures, such as a netlist. This conversion may comprise two different conversions: (1) synthesis of the input circuit design 20, and (2) property compilation of the properties in the verification specification 30.

The results of the design synthesis and the property compilation are then combined into a common problem instance that is given as input to a model checker in the verification tool 100. The verification tool 100 then performs formal verification on the circuit design 20 using the statically allocated data structure. For asserts, during the formal verification process, the model checker attempts to determine whether there is a possible behavior of the circuit design 20 where one of the properties in the verification specification 30 are not true, which is called a counterexample for the property. If, it is determined that no counterexample exists for a property, the property is said to be proven. The results 30 of the formal verification process thus comprise an indication of whether one or more of the properties are satisfied, and if not, the counterexample showing a condition under which the property fails. The tool 100 outputs the result 30 of the verification process.

The verification of a cover may proceed in a similar way. In one embodiment, for a cover, the verification tool attempts to find a counterexample to the negation of the property. This counterexample is called a cover trace. Thus, the techniques described below concerning asserts may be applied to covers as well.

The result 30 of the formal verification process may be stored in memory, passed along to another software process, or displayed to the user. The result may comprise a counterexample if the circuit design 20 fails to meet the properties encoded in the verification specification or a witness if the design 20 satisfies the properties. A debugging tool 110 may also be included to display the counterexample or witness to a circuit designer in a useful way to the designer. This can facilitate understanding of what aspect of the HDL code in the circuit design 20 is responsible for the counterexample to the property in question. The debugging tool 110 may include a viewer as well as editing software.

Debugging Tool

Embodiments of the invention provide for a debugging tool that may help the circuit designer better understand counterexamples, and thereby more easily debug the circuit design when counterexamples are found. An example operation of the debugging tool is shown in FIG. 2, which can be performed for any counterexample identified during the formal verification process. The debugging tool first receives 210 the results from the verification tool and presents them to the user. The user may choose a counterexample to analyze, so the debugging tool receives 220 this user selection of which counterexample to analyze, where the counterexample is associated with a property violated by the circuit design.

The debugging tool then selects 230 a set of explanatory points for the violated property. The set of explanatory points illustrates what parts of the counterexample directly contribute to the violation of the property. The debugging tool displays 240 a trace with information that will assist the designer to understand the cause of the circuit design's behavior. Rather than merely present a trace for the counterexample, the debugging tool can present the circuit designer with the trace showing the counterexample along with the explanatory points, as well as additional information that might help the designer to understand the nature of how the counterexample violates the property. This additional information may comprise annotations, markings, coloring, and/or other formatting on the trace that illustrates the counterexample, and/or the information may comprise selected portions of the circuit design code itself related to the counterexample trace with any coloring or formatting that may assist in the understanding of the counterexample.

Described herein is an embodiment of an interface and an operation of a debugging tool that provides helpful information to a circuit designer when a counterexample is found. The interfaces and functionalities described herein are presented for explanation purposes, and it can be appreciated that a variety of other user interface techniques can be provided with the debugging tool to convey the same or similarly helpful information about the counterexample. As described, the debugging tool obtains a set of explanatory points. Preferably, this set of points is sufficient and minimal with respect to the property and the trace.

One way to explain why a certain trace is a counterexample to a certain property is to point to the signal@cycle points of the trace that together give an explanation for why the property fails at the trace. Such a set of points can be called a set of explanatory points for the property. A set of explanatory points of a trace is sufficient with respect to a certain property if any other trace that is identical to the trace in question at the explanatory points is also a counterexample to the property. Furthermore a sufficient set of explanatory points of a trace is minimal with respect to a property if it is such that if any point of the trace is removed it is no longer a sufficient set.

Sometimes different sufficient and minimal sets of explanatory points can be identified for the same property and counter example. For example, given the PSL property always {a;b[*];c}|=>d and the trace shown in FIG. 3, all of the following explanatory sets contain sufficient explanations why the property fails on the trace:

-   -   E3={a@3,b@4, . . . b@19,c@20,d@21}     -   E6={a@6,b@7, . . . b@19,c@20,d@21}     -   E10={a@10,b@11, . . . b@19,c@20,d@21}     -   E13={a@13,b@14, . . . b@19,c@20,d@21}     -   E19={a@19,c@20,d@21}         It is also the case that all supersets of the sets E3, . . . E19         are sufficient explanatory sets. Furthermore all of the sets E3,         . . . E19 are minimal in the sense that they contain no smaller         subset that is a sufficient explanatory set.

As this example demonstrates, the debugging tool may need to choose which minimal set among different possible minimal sets to display to the user. Embodiments of the debugging tool can use different possible candidates. One possibility is to select one of the shortest minimal sets, where the shortest set is the one having the least difference between the earliest cycle and the failure point. Another possibility is to select the minimal set that contains the least number of points. Alternatively, the selection may be based on a combination of the above considerations, as well as others criteria.

In one embodiment, a step-based algorithm is used, giving a set of explanatory points that is both sufficient and minimal. Embodiments of the algorithm described herein give a set of explanatory points that is sufficient in the following sense. A set of explanatory points gives a sufficient explanation of property failure if every other trace that has the same values on the explanatory points in question is also a counterexample to the property. Embodiments of the algorithm may also give a set of explanatory points that are minimal with respect to sufficiency in the following sense. A set of explanatory points is minimal (with respect to sufficiency) if the set is no longer sufficient if one point is removed from the set.

Based on the structure of the formula and the way the step algorithm is computed, distinctions can be made between different syntactic/semantic roles of explanatory points. In one embodiment, an important distinction is between a point that contributes to the triggering of a property and a point that contributes directly to the falsity of the formula. This is illustrated by the formula: always {a;b[*];c}|=>d and the trace shown in FIG. 4. In this trace, the points a@13, b@14, . . . , b@19 and c@20 are colored blue, and the point d@21 is colored red (the colors displayable by the tool, but shown shaded in the figures). The blue markings indicate explanatory points that contribute to the triggering of the property and the red marking indicates an explanatory point that directly contributes to the failure of the property.

In another embodiment, the debugging tool may display this information by letting the user choose a cycle. The tool then displays the formula source, while coloring those signal instances, if any, in the formula source that have an explanatory point at that cycle. Continuing the previous example, this may be done with the following:

-   -   13 −>always {a;b[*];c}|=>d     -   14 −>always {a;b[*];c}|=>d     -   15 −>always {a;b[*];c}|=>d     -   . . .     -   19 −>always {a;b[*];c}|=>d     -   20 −>always {a;b[*];c}|=>d     -   21 −>always {a;b[*];c}|=>d         In this example, at cycle 13, a is colored blue; at cycles 14 to         19, b is colored blue; at cycle 20, c is colored blue; and at         cycle 21 d, is colored red.

In one embodiment, the debugging tool allows the user to indicate a certain cycle. This indication can be made via a movable vertical ruler that can be placed at a certain cycle with a mouse click. An example is shown for always {a;b[*];c}|=>d and the trace illustrated in FIG. 5. In this trace, the points a@13, b@14, . . . , b@19, and c@20 are colored blue, and the point d@21 is colored red. This trace can be used for stepping through the counterexample and follow for each successive cycle what parts of the formula or the HDL source code that get activated in evaluating the formula.

For example, for the formula always {r1; r2; r3 }|=>{r4} and the Verilog source code defining a circular shift among the registers r1, r2 and r3:

always @(posedge cl_fast,posedge rst)  begin   if (rst==1)     begin      r1 <= 1;      r2 <= 0;      r3 <= 0;      r4 <= 0;     end   else    begin      r4 <= r2;      r3 <= r2;      r2 <= r1;      r1 <= r3;    end  end The counterexample shown in FIG. 6 is obtained. In this trace the points r1@1, r2@2 and r3@3 are colored blue, and the point r4@4 is colored red.

This information can be used to provide stepwise highlighting of the source:

Cycle 1: if (rst==1)  begin    r1 <= 1;   .   .  end At cycle 1, the value 1 that is assigned to r1 is colored blue.

Cycle 2: if (rst==1)   .   . else  begin   .   .    r2 <= r1;   .   .  end At cycle 2, r1 that is assigned to r2 is colored blue.

Cycle 3: if (rst==1)   .   . else  begin   .   .     r3 <= r2;   .   .  end At cycle 3, r2 that is assigned to r3 is colored blue.

Cycle 4: if (rst==1)   .   . else  begin   .   .    r4 <= r2;  end At cycle 4, r2 that is assigned to r4 is colored blue.

One can choose to include points that are non-essential for explanatory sufficiency but which contribute to the understanding of why a certain value has been checked. For example, for the formula: always {a}|=>{b[*15];c} on the trace shown in FIG. 7. Only a@2 (blue) and b@17 (red) are essential to explain failure, but the user may want to have an indication that it is via the long row of confirming b's—b@3, . . . b@16 (colored green in the following example)—that b@17 is reached.

When the formula is detected to be false in the syntactic failure check it may be a disjunction. This means that each of the disjuncts are computed to be false. It is noted that in this situation, each and every one of the disjuncts need to be false for the property to fail. In this case the formula “has reached falsity” along different threads. This information is available and may be of value to the user. For example, for the formula always {a}|=>{{b[* 15];c}|{b[* 10];d[*3]}} and the trace shown in FIG. 9. The property fails at two separate explanatory points, d@16 (red) and c@19 (red), both of which are needed to explain failure. It may not be evident to the user, however, how these points were reached in the evaluation of the property. This may be explained by means of a threaded display of intermediate points, as in FIGS. 10 and 11. In the trace shown in FIG. 10, a@3 is colored blue; b@4, . . . , b@18 are green; d@16 is grey; and c@19 is red. In the trace shown in FIG. 11, a@3 is colored blue; b@4, . . . , b@13; d@14 and d@15 are green; d@16 is red; and c@19 is gray. In one embodiment, the user can click on the different red points separately to see how each of them was reached.

Embodiments of the debugging tool support multithreading. The following formula: always {a}|=>{b[*];c} will have the minimal set of explanatory points on the trace shown in FIG. 12. In the trace of FIG. 12, a@4 is colored blue, and c@5, . . . , c@18 and b@18 are red. The tool may indicate for each disconfirming explanatory point separately the thread of confirming signal@cycle points leading up to it. This is shown in the trace of FIG. 13, where a@4 is colored blue; c@5, . . . , c@12 and c@14, . . . , c@18; b@18 are grey; and c@13 is red.

The following formula contains different instances of the signal rcving: always {!rcving;rcving}|=>{rcving[*]}; {done_rcving & !rcving} This fails on the trace shown in FIG. 14, with the explanatory points in a minimal such set colored red and blue. In this trace, rcving@11 and rcving@12 are colored blue; and rcving@13, rcving@15, done_rcving@14, and done_rcving@15 are red. The rcving signal may seem a little cluttered with explanatory points in this diagram. In fact, the different explanatory points can be seen to be distributed over the different instances of this signal, as can be seen in the trace shown in FIG. 15. In the trace of FIG. 15, there are four different waveforms for the same signal rcving. The tool may show how different explanatory points distribute over the different instances of rcving in the formula. Here rcving :0 is the first occurrence of rcving in the formula, rcving:1 the second, and so on. In the trace of FIG. 15, rcving:0@11 and rcving:1@12 are colored blue; and rcving:3@13, rcving:2@15, done_rcving@14, and done_rcving@15 are red.

This differentiated information can be used to highlight the different instances of rcving when stepping through the formula.

-   -   10−>always {!rcving;rcving}|=>{rcving[*]}; {done_rcving &         !rcving}     -   11−>always {!rcving;rcving}|=>{rcving[*]}; {done_rcving &         !rcving}[rcving:0 is blue]     -   12−>always {!rcving;rcving}|=>{rcving[*]}; {done_rcving &         !rcving}[rcving:1 is blue]     -   13−>always {!rcving;rcving}|=>{rcving[*]}; {done_rcving &         !rcving}[rcving:3 is red]     -   14−>always {!rcving;rcving}|=>{rcving[*]}; {done_rcving &         !rcving}[done_rcving is red]     -   15−>always {!rcving;rcving}|=>{rcving[*]};{done_rcving &         !rcving} [done_rcving and rcving:2 are red]     -   16−>always {!rcving;rcving}|=>{rcving[*]};{done_rcving &         !rcving}         Use Model

In one embodiment, a user uses the debugging tool to view and analyze counterexamples found in formal verification. The debugging tool obtains the results from a formal verification tool and selects a disproved property (i.e., a property for which the formal verification tool found a counterexample). The debugging tool displays a plot window showing a trace diagram with the signals contained in the property showing the counterexample. In this trace diagram, the essential explanatory points are marked red or blue. If there is only one thread, inessential points indicating this thread may also be present (e.g., in green). If there is more than one thread, green points may be absent and can be brought forward by a user action such as clicking on red points.

The user may then choose to bring up a steppable source code viewer for either the PSL/SVA property source or the relevant HDL source. Using the steppable property source viewer in the debugging tool, the trace in question can be stepped through showing with color markings which property signal instances are marked as either blue, green, or red at the respective cycle of the counterexample. In this way, the user can view and analyze the counterexamples found during formal verification to understand the counterexamples better and thus debug the errors in the circuit design leading to the violation of the property.

In another embodiment, the debugging tool can be used to highlight cover traces and show the points in the cover trace that explain why the trace exemplifies the property or sequence to be covered. A cover trace is a counterexample to the negation of the covered property. Therefore, the same algorithm used to highlight counterexamples to asserts can be used to highlight cover traces.

Algorithm

Described herein is one algorithm for computing a set of explanatory points. The ATD function defined below will take a finite trace and a property as arguments and return a set of points of that trace. If the property fails on the trace, the returned set of points is a set of explanatory points as explained above, giving a sufficient and minimal explanation of the failure of the property.

Initial Definitions

We start by defining abstract and concrete words and letters. In order to model runs of a hardware system we use the concept of a word. A word w can be thought of as a possibly infinite sequence of states of the system (the letters), where each of the states (each letter) defines a value for all signals of the system.

We introduce abstraction at this point because we want to talk about “partial” runs, for example those parts of runs that are explanatory sets. Let Σ be a set of atoms. A letter l is a pair

T,F

of subsets of Σ where

T∩F

=Ø. If S

Σ then a letter

T,F

is full (concrete) with respect to S if S=

T∪F

.

Definition 1 A letter

T,F

is an abstraction of a letter

T′,F′

(

T,F

T′,F′

) if T

T′ and F

F′. (And l

l′ if l≠l′ and l

l′.) Obviously,

is a partial order on the set of letters. A letter

T,F

is empty if both T and F are empty.

Definition 2

T,F

T′,F

=

T∩T′, F∩F′

. If

T,F

and

T′,F′

are letters then

T,F

T′,F′

is a letter.

Definition 3

T,F

␣

T′,F′

=

T∩T′, F∪F′

. There are letters

T,F

and

T′,F′

such that

T,F

␣

T′,F′

is not a letter. For example, it may be the case that T∩F′≠∅, in which case (T∪T′)∩(F∪F′)≠∅.

An infinite (finite) word (w,v,u) is a list l₀, l₁, l₂, . . . (l₀, . . . l_(n−1)) of letters. We will also regard words as mappings from the integers (or a prefix of the integers) into the set of letters, this means that w(n) is the n+1th letter of w. v

u means v is a prefix of u. SI(w) the start index of w is the index of the first letter of w. A cycle number (n) is any non negative integer.

Definition 4 A work w is an abstraction of a word w′ (w

w′) if for each cycle number n, w(n)

w′(n). (And w

w′ if w≠w′ and w

w′.)

Definition 5 w

w′=w″ if and only if for each n, w″(n)=w(n)

w′(n).

If w and w′ are letters then w

w′ is a letter.

Definition 6 w␣w′=w″ if and only if for each n w″(n)=w(n)␣w′(n).

There are words w and w′ such that w␣w′ is not a word. For example it may be the case that for some n w(n)␣w′(n) is not a letter.

The building blocks of PSL/SVA formulas are Boolean formulas. We define satisfaction for Boolean formulas on letters in such a way that we make explicit what signal values were needed to determine satisfaction.

We try to do this in an economical way, respecting sufficiency and minimality. For example if a conjunction is false we only collect the signals that were needed for falsifying one of the false conjuncts.

Boolean satisfaction

A Boolean formula is a Boolean combination of elements of Σ.

Definition 7 b::=|a|

b|bΛb|b

b Boolean satisfaction on full letters is defined in the following way: bs(b,l)=

tf, U

where tf is the value of l

b in the usual sense of boolean satisfaction and U is the subset of U is the subset of Σ that needed to be looked up to establish this fact.

Assume that l=<T_(l),F_(l)> is full with respect to S

Σ (i.e. F_(l)=S\T_(l)).

Definition 8 Let a ∈ S and b, b₁ and b₂ be any boolean formula.

bs(a, l) = ⟨a ∈ T_(l), {a}⟩ bs(−b, l) = ⟨ ⫬ tf, U⟩  where  ⟨tf, U⟩ = bs(b, l) $\begin{matrix} {{{bs}\left( {{b_{1}\bigwedge b_{2}},l} \right)} = {\left\langle {{tf},U} \right\rangle\mspace{14mu}{where}}} \\ {{tf} = {{tf}_{1}\bigwedge{tf}_{2}}} \\ {U = \left\{ \begin{matrix} {U_{1}\bigcup U_{2}} & {{if}\mspace{14mu}{tf}} \\ U_{2} & {{if}{⫬ {{tf}\bigwedge{tf}_{1}}}} \\ U_{1} & {{otherwise}.} \end{matrix} \right.} \\ {\left\langle {{tf}_{1},U_{1}} \right\rangle = {{bs}\left( {b_{1},l} \right)}} \\ {\left\langle {{tf}_{2},U_{2}} \right\rangle = {{bs}\left( {b_{2},l} \right)}} \\ {{{bs}\left( {{b_{1}\bigvee b_{2}},l} \right)} = {\left\langle {{tf},U} \right)\mspace{14mu}{where}}} \\ {{tf} = {{tf}_{1}\bigvee{tf}_{2}}} \\ {U = \left\{ \begin{matrix} {U_{1}\bigcup U_{2}} & {{if}{⫬ \mspace{14mu}{tf}}} \\ U_{2} & {{if}\mspace{14mu}{{tf}\bigwedge{⫬ {tf}_{1}}}} \\ U_{1} & {{otherwise}.} \end{matrix} \right.} \\ {\left\langle {{tf}_{1},U_{1}} \right\rangle = {{bs}\left( {b_{1},l} \right)}} \\ {\left\langle {{tf}_{2},U_{2}} \right\rangle = {{bs}\left( {b_{2},l} \right)}} \end{matrix}$

Properties of the AD Functions

Below, in Definition 28, we will define the ATD function. The ATD function applied to a finite word u and a formula p will return an abstraction u′ of that word. ATD(u,p)=u′

u′

u This abstraction represents a (possibly empty) set of explanatory points for the word and the formula in question. Here we define sufficiency and minimality formally. (=+denotes strong formula satisfaction as defined in the PSL/SVA LRM.)

The ATD Property

The ATD function should have the following property: If w is a (full) word and p is a (non pathological) safety property and w

p and u is the shortest prefix of w such that u

+ notp and ATD(u,p)=u′ then

-   -   1. for any full v such that u′         v, v         + notp (sufficiency).     -   2. if u″         u′ then there is full v such that u″         v, v         + notp (minimality)     -   3. for all u″ that also fulfills (1) and (2) with respect to u         and p, then u′ is at least as good as u″^(u″(u″≦) ^(g) ^(u′)) at         explaining the fact that u         + notp.         -   (1) requires that the abstraction returned by the ATD             function is sufficient to explain the failure of the             property. (See Observation 1)         -   (2) requires that the abstraction returned by the ATD             function is a minimal one explaining the failure of the             property. (See Observation 1)         -   (3) requires that the abstraction returned is at least as             good as any other sufficient minimal explanation. Presumably             this requirement should amount to some sort of minimality             among the minimal explanations.

We need to specify the ‘at least as good’ part. Let start(u) be the least cycle number n such that u(n) is nonempty if there is one otherwise it is undefined. If u,v and w are finite words and u,v

w then u≦_(g)v if start(u)≦start(v) (Shortest ATD)

The Core PSL Language with ATD

We will give a operational semantics for the core PSL/SVA language which will not only be usable for computing the semantic value of a formula on a run but will also compute the relevant set of explanatory points. We will define a data structure that will hold information on collected possible explanatory points. This data structure can be attached to arbitrary nodes in the abstract syntax tree. We will also define some operations on this data structure that will be needed for defining the various formula transformations required by the operational semantics.

Syntactic Definitions

$\begin{matrix} \begin{matrix} {{{Seq}\text{::}} = {❘{\left\langle {\left\lbrack {*0} \right\rbrack,{US}} \right\rangle ❘{\left\langle {\bot{,{US}}} \right\rangle ❘\left\langle {b,{US}} \right\rangle}}}} \\ {❘{\left\langle {\left( {{Seq}_{1}\&\&{Seq}_{2}} \right),{US}} \right\rangle ❘{\left\langle {\left( {{Seq}_{1}❘{Seq}_{2}} \right),{US}} \right\rangle ❘}}} \\ {\left\langle {\left( {{Seq}_{1};{Seq}_{2}} \right),{US}} \right\rangle} \\ {❘{\left\langle {\left( {{Seq}_{1};{Seq}_{2}} \right),{US}} \right\rangle ❘\left\langle {{{Seq}\lbrack*\rbrack},{US}} \right\rangle}} \end{matrix} & {{Definition}\mspace{14mu} 15} \\ \begin{matrix} {{{Pred}\text{::}} = {❘{\left\langle {{alwaysPred},{UP}} \right\rangle ❘}}} \\ {\left\langle {\left( {{Pred}_{1}{untilPred}_{2}} \right),{UP}} \right\rangle ❘\left\langle {{{{next}\lbrack n\rbrack}{Pred}},{UP}} \right\rangle} \\ {❘{\left\langle {\left( {{Pred}_{1}{{and}{Pred}}_{2}} \right),{UP}} \right\rangle ❘\left\langle {\left( {{Pred}_{1}{orPred}_{2}} \right),{UP}} \right\rangle}} \\ {❘{\left\langle {\left( {Seq}\mapsto{Pred} \right),{UP}} \right\rangle ❘\left\langle {({Predabortb}),{UP}} \right\rangle}} \\ {❘\left\langle {\left\{ {Seq} \right\},{UP}} \right\rangle} \end{matrix} & {{Definition}\mspace{14mu} 16} \end{matrix}$ Note that there is no negation in the Pred language. For simplicity we assume that the language is negation free. For simplicity we write s for

s, emptyUS

and φ for

φ, emptyUP

, respectively.

Collecting Explanatory Points

Each node in the formula tree is a pair of an operator and a cycle map (US,UP) specifying the set of used signals for each cycle number. For each cycle number n, US(n)

Σ. UP(n) is a set of pairs

where, name

where name name ∈ Σ and where is a tag indicating whether name was used in a suffix implication left hand side (lhs) or elsewhere (rhs)

We define Definition 9 us ₁ ∪us ₂ =u such that for each n, u(n)=us ₁(n)∪ us ₂(n)

We define Definition 10 us ₁ ∪us ₂ =u such that for each n, u(n)=us ₁(n)∪ us ₂(n)

-   -   if U         Σ (or U is a set of         where, name         pairs) and n is a cycle number, let unitcm(U, n) be the cycle         map US such that US(n)=U and US(m)=∅ if m≠n.         We also define, recursively, Definition 11

${{merge}\left( {U_{1},\ldots\mspace{14mu},U_{n}} \right)} = \left\{ \begin{matrix} U_{1} & {{{if}\mspace{14mu} n} = 1} \\ {U_{1}\bigcup U_{2}} & {{{if}\mspace{14mu} n} = 2} \\ {{merge}\left( {{{merge}\left( {U_{1},{\ldots\mspace{14mu} U_{n - 1}}} \right)},U_{n}} \right)} & {{{if}\mspace{14mu} n} > 2} \end{matrix} \right.$ if U

Σ (or U is a set of

where, name

pairs) and US is a cycle map and n a cycle number then let: append (US,U,n)=merge (US, unitcm(U,n)) emptyUS=F, where for all n F(n)=∅ emptyUP=F, where for all n F(n)=∅.

Definition 12

${{laterused}\left( {{US}_{1},{US}_{2}} \right)} = \left\{ \begin{matrix} {US}_{2} & {{{{if}\mspace{14mu}{start}\mspace{14mu}\left( {US}_{1} \right)} < {{{start}\left( {US}_{2} \right)}\bigvee{US}_{1}}} = {{empty}{US}}} \\ {US}_{1} & {{otherwise}.} \end{matrix} \right.$ We extend Definition 12 to the case where the operands are other than two.

Definition 13

${{mlaterused}\left( {{US}_{1},{\ldots\mspace{14mu}{US}_{n}}} \right)} = \left\{ \begin{matrix} {US}_{1} & {{{if}\mspace{14mu}{US}_{1}} = {US}_{2}} \\ {{laterused}\left( {{US}_{1},{US}_{n}} \right)} & {{{if}\mspace{14mu} n} = 2} \\ {{laterused}\left( {{US}_{1},{{mlaterused}\left( {{US}_{2},{\ldots\mspace{14mu}{US}_{n}}} \right)}} \right)} & {otherwise} \end{matrix} \right.$

If s is a sequence, let addUS(

s, US ₁

, US ₂)=

s, merge(US ₁ , US ₂)

If p is a formula, let addUP(

p, UP ₁

, UP ₂)=

p, merge(UP ₁ , UP ₂)

Let toLhss(US)=UP, where for all n UP(n)={

lhs, name

|name ∈ US(n)} and let toRhss(US)=UP, where for all n UP(n)={

rhs, name

|name ∈ US(n)}.

The following functions are used to collect signals that were used for checking a particular sequence or formula. getUsedsS(s) collects and merges all the USs in s, and getUsedsP(p) collects and merges all the UPs in p.

The interesting cases in getUsedsP is where getUsedsS gets used.

-   -   getUsedsP(         (s         p), UP         )=merge(UP, toLhss(getUsedsS(s)), getUsedsP(p)) getUsedsP(         {s}, UP         )=merge(UP, toRhss(getUsedsS(s)))

We define Definition 14 us ₁

us ₂

for each n, us ₁(n)

us ₂(n)

Sequence Step Function with ATD

The seqstep function defines the operational semantics for Seq's. It defines a stepwise transformation of a sequence when traversing a word. This is done in such a way that sequence matching is syntactically detectable (see the em function below).

Definition 17

$\begin{matrix} {{{seqstep}\left( {n,l,\left\langle {\left\lbrack {*0} \right\rbrack,{US}} \right\rangle} \right)} = \left\langle {\bot{,{US}}} \right\rangle} \\ {{{seqstep}\left( {n,l,\left\langle {\bot{,{US}}} \right\rangle} \right)} = \left\langle {\bot{,{US}}} \right\rangle} \end{matrix}$ $\begin{matrix} {{{seqstep}\left( {n,l,\left\langle {b,{US}} \right\rangle} \right)} = {\left\langle {S,{{append}\left( {{US},U,n} \right)}} \right\rangle\mspace{14mu}{where}}} \\ {\left\langle {{tf},U} \right\rangle = {{bs}\left( {b,l} \right)}} \\ {S = \left\{ \begin{matrix} \left\lbrack {*0} \right\rbrack & {{if}\mspace{14mu}{tf}} \\ \bot & {otherwise} \end{matrix} \right.} \\ {{{seqstep}\left( {n,l,\left\langle {\left( {s_{1}\&\& s_{2}} \right),{US}} \right\rangle} \right)} = {\left\langle {\left( {s_{1}^{\prime}\&\& s_{2}^{\prime}} \right),{US}} \right\rangle\mspace{14mu}{where}}} \\ {s_{1}^{\prime} = {{seqstep}\left( {n,l,s_{1}} \right)}} \\ {s_{2}^{\prime} = {{seqstep}\left( {n,l,s_{2}} \right)}} \\ {{{seqstep}\left( {n,l,\left\langle {\left( {s_{1}❘s_{2}} \right),{US}} \right\rangle} \right)} = {\left\langle {\left( {s_{1}^{\prime}❘s_{2}^{\prime}} \right),{US}} \right\rangle\mspace{14mu}{where}}} \\ {s_{1}^{\prime} = {{seqstep}\left( {n,l,s_{1}} \right)}} \\ {s_{2}^{\prime} = {{seqstep}\left( {n,l,s_{2}} \right)}} \end{matrix}$ $\begin{matrix} {{{seqstep}\left( {n,l,\left\langle {\left( {s_{1};s_{2}} \right),{US}} \right\rangle} \right)} = {S\mspace{14mu}{where}}} \\ {S = \left\{ \begin{matrix} \left\langle {\left( {s_{2}^{\prime}❘\left( {s_{1}^{\prime};s_{2}} \right)} \right),{US}} \right\rangle & {{if}\mspace{14mu}{ae}} \\ \left\langle {\left( {s_{1}^{\prime};s_{2}} \right),{US}} \right\rangle & {otherwise} \end{matrix} \right.} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}\left( s_{1} \right)}} \\ {s_{1}^{\prime} = {{seqstep}\left( {n,l,s_{1}} \right)}} \\ {s_{2}^{\prime} = {{addUS}\left( {{{seqstep}\left( {n,l,s_{2}} \right)},{us}} \right)}} \\ {{{seqstep}\left( {n,l,\left\langle {\left( {s_{1};s_{2}} \right),{US}} \right\rangle} \right)} = {S\mspace{14mu}{where}}} \\ {S = \left\{ \begin{matrix} \left\langle {\left( {s_{2}^{\prime}❘\left( {s_{1}^{\prime};s_{2}} \right)} \right),{US}} \right\rangle & {{if}\mspace{14mu}{ae}} \\ \left\langle {\left( {s_{1}^{\prime};s_{2}} \right),{US}} \right\rangle & {otherwise} \end{matrix} \right.} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}\left( s_{1}^{\prime} \right)}} \\ {s_{1}^{\prime} = {{seqstep}\left( {n,l,s_{1}} \right)}} \\ {s_{2}^{\prime} = {{addUS}\left( {{{seqstep}\left( {n,l,s_{2}} \right)},{us}} \right)}} \end{matrix}$ $\begin{matrix} {{{seqstep}\left( {n,l,\left\langle {{s\lbrack*\rbrack},{US}} \right\rangle} \right)} = {\left\langle {\left( {s^{\prime};{s\lbrack*\rbrack}} \right),{US}} \right\rangle\mspace{14mu}{where}}} \\ {s_{1}^{\prime} = {{seqstep}\left( {n,l,s_{1}} \right)}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {{alwaysp},{UP}} \right\rangle} \right)} = {{{predstep}\left( {n,l,\left\langle {({pandnap}),{UP}} \right\rangle} \right)}\mspace{14mu}{where}}} \\ {{nap} = {{{next}\lbrack 1\rbrack}{alwaysp}}} \\ {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{untilp}_{2}} \right),{UP}} \right\rangle} \right)} = {{predstep}\left( {n,l,\left\langle {\left( {p_{2}{{or}\left( {p_{1}{andnu}} \right)}} \right\rangle,} \right.} \right.}} \\ {\left. \left. {UP} \right\rangle \right)\mspace{14mu}{where}} \\ {{nu} = {{{next}\lbrack 1\rbrack}\left( {p_{1}{untilp}_{2}} \right)}} \end{matrix}$ ${{predstep}\left( {n,l,\left( {{{{next}\lbrack m\rbrack}p_{2}},{UP}} \right\rangle} \right)} = \left\{ {\begin{matrix} \begin{matrix} {{predstep}\left( {n,l,} \right.} \\ \left. {{addUP}\left( {p_{2},{UP}} \right)} \right) \end{matrix} & {{{{if}\mspace{14mu} m} = 0},} \\ \left\langle {{{{next}\left\lbrack {m - 1} \right\rbrack}p_{2}},{UP}} \right\rangle & {{otherwise}.} \end{matrix}\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{andp}_{2}} \right),{UP}} \right\rangle} \right)} = {\left\langle {\left( {p_{1}^{\prime}{andp}_{2}^{\prime}} \right),{UP}} \right\rangle\mspace{14mu}{where}}} \\ {p_{1}^{\prime} = {{predstep}\left( {n,l,p_{1}} \right)}} \\ {p_{2}^{\prime} = {{predstep}\left( {n,l,p_{2}} \right)}} \\ {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{orp}_{2}} \right),{UP}} \right\rangle} \right)} = {\left\langle {\left( {p_{1}^{\prime}{orp}_{2}^{\prime}} \right),{UP}} \right\rangle\mspace{14mu}{where}}} \\ {p_{1}^{\prime} = {{predstep}\left( {n,l,p_{1}} \right)}} \\ {p_{2}^{\prime} = {{predstep}\left( {n,l,p_{2}} \right)}} \end{matrix}\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( s\mapsto p \right),{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left( {\left( {p^{\prime}{{and}\left( s^{\prime}\mapsto p \right)}} \right),{UP}} \right\rangle & {{if}\mspace{14mu}{ae}} \\ \left( {\left( s^{\prime}\mapsto p \right),{UP}} \right\rangle & {{otherwise}.} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}\left( s^{\prime} \right)}} \\ {s^{\prime} = {{seqstep}\left( {n,l,s} \right)}} \\ {p^{\prime} = {{addLhss}\left( {{{predstep}\left( {n,l,p} \right)},{us}} \right)}} \end{matrix}\begin{matrix} {{{predstep}\left( {n,l,\left\langle {({pabortb}),{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left\langle {\left\{ \left\lbrack {*0} \right\rbrack \right\},{{merge}\left( {{UP},{pus},F} \right)}} \right\rangle & {{{if}\mspace{14mu}{{ok}\bigwedge{tf}}}\mspace{14mu}} \\ \left\langle {\left( {p^{\prime}{abortb}} \right),{{merge}\left( {{UP},F} \right)}} \right\rangle & {{otherwise}.} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ok},{us}} \right\rangle = {{okp}(p)}} \\ {\left\langle {{tf},U} \right\rangle = {{bs}\left( {b,l} \right)}} \\ {{pus} = {{getUsedsP}(p)}} \\ {F = {{toRhss}\left( {{unitcm}\left( {U,n} \right)} \right)}} \\ {p^{\prime} = {{predstep}\left( {n,l,p} \right)}} \end{matrix}\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left\{ s \right\},{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left. \left\langle {\left\{ \left\lbrack {*0} \right\rbrack \right\},{UP}} \right) \right\rangle & {{if}\mspace{14mu}{ae}} \\ \left\langle {\left\{ {{seqstep}\left( {n,l,s} \right\}} \right),{UP}} \right\rangle & {otherwise} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}(s)}} \end{matrix}} \right.$

Formula Step Function with ATD

$\begin{matrix} {{{predstep}\left( {n,l,\left\langle {{always}_{p},{UP}} \right\rangle} \right)} = {{predstep}\left( {n,l,\left\langle {({pandnap}),{UP}} \right\rangle} \right)}} \\ {where} \\ {{nap} = {{{next}\mspace{14mu}\lbrack 1\rbrack}\mspace{14mu}{alwaysp}}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{untilp}_{2}} \right),{UP}} \right\rangle} \right)} = {{predstep}\left( {n,l,\left\langle {p_{2}{{or}\left( {p_{1}{andnu}} \right)}} \right),} \right.}} \\ {\left. \left. {UP} \right\rangle \right)\mspace{14mu}{where}} \\ {{nu} = {{{next}\mspace{14mu}\lbrack 1\rbrack}\left( {p_{1}{untilp}_{2}} \right)}} \end{matrix}$ ${{predstep}\left( {n,l,\left\langle {{{{next}\lbrack m\rbrack}p_{2}},{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} {{predstep}\left( {n,l,} \right.} & {{{if}\mspace{14mu} m} = 0} \\ \left. {{addUP}\left( {p_{2},{UP}} \right)} \right) & \; \\ \left\langle {{{{next}\left\lbrack {m - 1} \right\rbrack}p_{2}},} \right. & {{otherwise},} \\ \left. {UP} \right\rangle & \; \end{matrix}\quad \right.$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{{and}p}_{2}} \right),{UP}} \right\rangle} \right)} = {\left\langle {\left( {p_{1}^{\prime}{{and}p}_{2}^{\prime}} \right),{UP}} \right\rangle\mspace{14mu}{where}}} \\ {p_{1}^{\prime} = {{predstep}\left( {n,l,p_{1}} \right)}} \\ {p_{2}^{\prime} = {{predstep}\left( {n,l,p_{2}} \right)}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( {p_{1}{{or}p}_{2}} \right),{UP}} \right\rangle} \right)} = {\left\langle {\left( {p_{1}^{\prime}{{or}p}_{2}^{\prime}} \right),{UP}} \right\rangle\mspace{14mu}{where}}} \\ {p_{1}^{\prime} = {{predstep}\left( {n,l,p_{1}} \right)}} \\ {p_{2}^{\prime} = {{predstep}\left( {n,l,p_{2}} \right)}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left( s\mapsto p \right),{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left( \left( {p^{\prime}{{and}\left( s^{\prime}\mapsto p \right)}} \right) \right. & {{if}\mspace{14mu}{ae}} \\ \left\langle {\left( s^{\prime}\mapsto p \right),{UP}} \right\rangle & {{otherwise},} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}\left( s^{\prime} \right)}} \\ {s^{\prime} = {{seqstep}\left( {n,l,s} \right)}} \\ {p^{\prime} = {{addLhss}\left( {{{predstep}\left( {n,l,p} \right)},{us}} \right)}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {({pabortb}),{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left\langle {\left\{ \left\lbrack {*0} \right\rbrack \right\},{{merge}\left( {{UP},} \right.}} \right. & {{if}\mspace{14mu}{{ok}\bigwedge{tf}}} \\ \left. \left. {{pus},F} \right) \right\rangle & \square \\ \left\langle {\left( {p^{\prime}{abortb}} \right),} \right. & {{otherwise},} \\ \left. {{merge}\left( {{UP},F} \right)} \right\rangle & \square \end{matrix} \right.} \\ {where} \\ {\left\langle {{ok},{us}} \right\rangle = {{okp}(p)}} \\ {\left\langle {{tf},U} \right\rangle = {{bs}\left( {b,l} \right)}} \\ {{pus} = {{getUsedsP}(p)}} \\ {F = {{toRhss}\left( {{unitcm}\left( {U,n} \right)} \right)}} \\ {p^{\prime} = {{predstep}\left( {n,l,p} \right.}} \end{matrix}$ $\begin{matrix} {{{predstep}\left( {n,l,\left\langle {\left\{ s \right\},{UP}} \right\rangle} \right)} = \left\{ \begin{matrix} \left. \left\langle {\left\{ \left\lbrack {*0} \right\rbrack \right\},{UP}} \right) \right\rangle & {{if}\mspace{14mu}{ae}} \\ \left\langle {\left\{ {{seqstep}\left( {n,l,s} \right\}} \right),{UP}} \right\rangle & {{otherwise},} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ae},{us}} \right\rangle = {{em}(s)}} \end{matrix}$

The em Function

The em function checks whether a Seq can accept the empty word. At the same time it collects all explanatory points needed for establishing this fact.

Definition 18

$\begin{matrix} {{{em}\left( \left\langle {\left\lbrack {*0} \right\rbrack,{US}} \right\rangle \right)} = \left\langle {{True},{US}} \right\rangle} \\ {{{em}\left( \left\langle {\bot{,{US}}} \right\rangle \right)} = \left\langle {{False},{emptyUS}} \right\rangle} \\ {{{em}\left( \left\langle {b,{US}} \right\rangle \right)} = \left\langle {{False},{emptyUS}} \right\rangle} \end{matrix}$ $\begin{matrix} {{{em}\left( \left\langle {\left\langle {s_{1}\&\& s_{2}} \right),{US}} \right\rangle \right)} = {\left\langle {{ae},{US}^{\prime}} \right\rangle\mspace{14mu}{where}}} \\ {{ae} = {{ae}_{1}\bigwedge{ae}_{2}}} \\ {{US}^{\prime} = \left\{ \begin{matrix} {{merge}\left( {{US},{us}_{1},{us}_{2}} \right)} & {{if}\mspace{14mu}{ae}} \\ {emptyUS} & {{otherwise}.} \end{matrix} \right.} \\ {\left\langle {{ae}_{1},{us}_{1}} \right\rangle = {{em}\left( s_{1} \right)}} \\ {\left\langle {{ae}_{1},{us}_{2}} \right\rangle = {{em}\left( s_{2} \right)}} \end{matrix}$ $\begin{matrix} {{{em}\left( \left\langle {\left( {s_{1}❘s_{2}} \right),{US}} \right\rangle \right)} = {\left\langle {{ae},{US}^{\prime}} \right\rangle\mspace{14mu}{where}}} \\ {{ae} = {{ae}_{1}\bigvee{ae}_{2}}} \\ {{US}^{\prime} = \left\{ \begin{matrix} {{merge}\left( {{US},{{laterused}\left( {{us}_{1},{us}_{2}} \right)}} \right)} & {{if}\mspace{14mu}{ae}} \\ {emptyUS} & {{otherwise}.} \end{matrix} \right.} \\ {\left\langle {{ae}_{1},{us}_{1}} \right\rangle = {{em}\left( s_{1} \right)}} \\ {\left\langle {{ae}_{2},{us}_{2}} \right\rangle = {{em}\left( s_{2} \right)}} \end{matrix}$ $\begin{matrix} {{{em}\left( \left\langle {\left( {s_{1};s_{2}} \right),{US}} \right\rangle \right)} = {\left\langle {{ae},{US}^{\prime}} \right\rangle\mspace{14mu}{where}}} \\ {{ae} = {{ae}_{1}\bigwedge{ae}_{2}}} \\ {{US}^{\prime} = \left\{ \begin{matrix} {{merge}\left( {{US},{us}_{1},{us}_{2}} \right)} & {{if}\mspace{14mu}{ae}} \\ {emptyUS} & {{otherwise}.} \end{matrix} \right.} \\ {\left\langle {{ae}_{1},{us}_{1}} \right\rangle = {{em}\left( s_{1} \right)}} \\ {\left\langle {{ae}_{2},{us}_{2}} \right\rangle = {{em}\left( s_{2} \right)}} \\ {{{em}\left( \left\langle {\left( {s_{1};s_{2}} \right),{US}} \right\rangle \right)} = \left\langle {{False},{emptyUS}} \right\rangle} \\ {{{em}\left( \left\langle {{s\lbrack*\rbrack},{US}} \right\rangle \right)} = \left\langle {{True},{{merge}\left( {{US},{{getUsedsS}(s)}} \right)}} \right\rangle} \end{matrix}$

The okp Function

The okp function checks whether a Pred is definitively contradicted. At the same time it collects all explanatory points needed for establishing this fact.

Definition 19

$\begin{matrix} {{{okp}\left( \left\langle {{alwaysp},{UP}} \right\rangle \right)} = {\left\langle {{ok},{emptyUP}} \right\rangle\mspace{14mu}{where}}} \\ {\left\langle {{ok},u} \right\rangle = {{okp}(p)}} \end{matrix}$ $\begin{matrix} {\left. {{{{okp}\left( \left\langle {\left( {p_{1}{untilp}_{2}} \right),{UP}} \right\rangle \right)} = {\left\langle {ok}_{1} \right.{ok}_{2}}},{emptyUP}} \right\rangle\mspace{14mu}{where}} \\ {\left\langle {{ok}_{1},u_{1}} \right\rangle = {{okp}\left( p_{1} \right)}} \\ {\left\langle {{ok}_{2},u_{2}} \right\rangle = {{okp}\left( p_{2} \right)}} \end{matrix}$ ${{okp}\left( \left\langle {{{{next}\lbrack n\rbrack}p},{UP}} \right\rangle \right)} = \left\{ {{\begin{matrix} {{okp}(p)} & {{{if}\mspace{14mu} n} = 0} \\ \left( {{True},{emptyUP}} \right\rangle & {{{if}\mspace{14mu} n} > 0} \end{matrix}\;\begin{matrix} {{{okp}\left( \left\langle {\left( {p_{1}{andp}_{2}} \right),{UP}} \right\rangle \right)} = {\left\langle {{ok},u} \right\rangle\mspace{14mu}{where}}} \\ {\left\langle {{ok}_{1},u_{1}} \right\rangle = {{okp}\left( p_{1} \right)}} \\ {\left\langle {{ok}_{2},u_{2}} \right\rangle = {{okp}\left( p_{2} \right)}} \\ {{ok} = {{ok}_{1}\bigwedge{ok}_{2}}} \\ {u = \left\{ \begin{matrix} {emptyUP} & {{if}\mspace{14mu}{ok}} \\ {{merge}\left( {{UP},{{laterused}\left( {u_{1},u_{2}} \right)}} \right)} & {otherwise} \end{matrix} \right.} \end{matrix}\begin{matrix} {{{okp}\left( \left\langle {\left( {p_{1}{orp}_{2}} \right),{UP}} \right\rangle \right)} = {\left\langle {{ok},u} \right\rangle\mspace{14mu}{where}}} \\ {\left\langle {{ok}_{1},u_{1}} \right\rangle = {{okp}\left( p_{1} \right)}} \\ {\left\langle {{ok}_{2},u_{2}} \right\rangle = {{okp}\left( p_{2} \right)}} \\ {{ok} = {{ok}_{1}\bigvee{ok}_{2}}} \\ {u = \left\{ \begin{matrix} {emptyUP} & {{if}\mspace{14mu}{ok}} \\ {{merge}\left( {{UP},u_{1},u_{2}} \right)} & {otherwise} \end{matrix} \right.} \end{matrix}{{okp}\left( \left\langle {\left( s\mapsto p \right),{UP}} \right) \right)}} = {{\left\langle {{True},{emptyUP}} \right\rangle\begin{matrix} {{{okp}\left( \left\langle {({pabortb}),{UP}} \right\rangle \right)} = \left\{ \begin{matrix} \left\langle {{True},{emptyUP}} \right\rangle & {{if}\mspace{14mu}{ok}} \\ \left\langle {{False},{{merge}\left( {{UP},{{getUsedsP}(p)}} \right)}} \right\rangle & {otherwise} \end{matrix} \right.} \\ {where} \\ {\left\langle {{ok},u} \right\rangle = {{okp}(p)}} \end{matrix}{{okp}\left( \left\langle {\left\{ s \right\},{UP}} \right\rangle \right)}} = \left\{ \begin{matrix} \left\langle {{True},\phi} \right\rangle & {{if}\mspace{14mu}{{oks}(s)}} \\ \left\langle {{False},{{merge}\left( {{UP},{{getUsedsS}(p)}} \right\rangle}} \right. & {otherwise} \end{matrix} \right.}} \right.$

We will define a strong variant of formula equivalence.

The oks Function

Definition 21

$\begin{matrix} {{{oks}\left( \left\langle {\left\lbrack {*0} \right\rbrack,{US}} \right\rangle \right)} = \left\langle {{True},{emptyUS}} \right\rangle} \\ {{{oks}\left( \left\langle {\bot{,{US}}} \right\rangle \right)} = \left\langle {{False},{US}} \right\rangle} \\ {{{oks}\left( \left\langle {b,{US}} \right\rangle \right)} = \left\langle {{True},{emptyUS}} \right\rangle} \end{matrix}$ $\begin{matrix} {{{oks}\left( \left\langle {\left( {s_{1}\&\& s_{2}} \right),{US}} \right\rangle \right)} = \left\langle {{ok},{us}} \right\rangle} \\ {\left\langle {{ok}_{1}{us}_{1}} \right\rangle = {{oks}\left( s_{1} \right)}} \\ {\left\langle {{ok}_{2}{us}_{2}} \right\rangle = {{oks}\left( s_{2} \right)}} \\ {{ok} = {{ok}_{1}\bigwedge{ok}_{2}}} \\ {{us} = \left\{ \begin{matrix} {emptyUS} & {{if}\mspace{14mu}{ok}} \\ {{merge}\left( {{US},{{laterused}\left( {{u\; 1},{u\; 2}} \right)}} \right)} & {otherwise} \end{matrix} \right.} \end{matrix}$ $\begin{matrix} {{{oks}\left( \left\langle {\left( {s_{1}❘s_{2}} \right),{US}} \right\rangle \right)} = \left\langle {{ok},{us}} \right\rangle} \\ {\left\langle {{ok}_{1}{us}_{1}} \right\rangle = {{oks}\left( s_{1} \right)}} \\ {\left\langle {{ok}_{2}{us}_{2}} \right\rangle = {{oks}\left( s_{2} \right)}} \\ {{ok} = {{ok}_{1}\bigvee{ok}_{2}}} \\ {{us} = \left\{ \begin{matrix} {emptyUS} & {{if}\mspace{14mu}{ok}} \\ {{merge}\left( {{US},{u\; 1},{u\; 2}} \right)} & {otherwise} \end{matrix} \right.} \end{matrix}$ $\begin{matrix} {{{oks}\left( \left\langle {\left( {s_{1};s_{2}} \right),{US}} \right\rangle \right)} = \left\langle {{ok}_{1},{us}} \right\rangle} \\ {\left\langle {{ok}_{1},{us}_{1}} \right\rangle = {{oks}\left( s_{1} \right)}} \\ {{us} = \left\{ \begin{matrix} {emptyUS} & {{if}\mspace{14mu}{ok}_{1}} \\ {{merge}\left( {{US},{us}} \right)} & {otherwise} \end{matrix} \right.} \\ {{{oks}\left( \left\langle {\left( {s_{1}\text{:}s_{2}} \right),{US}} \right\rangle \right)} = \left\langle {{ok}_{1},{us}} \right\rangle} \\ {\left\langle {{ok}_{1}{us}_{1}} \right\rangle = {{oks}\left( s_{1} \right)}} \\ {{us} = \left\{ \begin{matrix} {emptyUS} & {{if}\mspace{14mu}{ok}_{1}} \\ {{merge}\left( {{US},{us}} \right)} & {otherwise} \end{matrix} \right.} \end{matrix}$ oks(⟨s[*], US⟩) = ⟨True, emptyUS⟩

Definition 22

For Pred φ and finite word l_(n) . . . l_(m) such that SI(v)=n

${\phi\left\langle {l_{n\mspace{14mu}}\ldots\mspace{14mu} l_{m}} \right\rangle} = \left\{ \begin{matrix} \phi & {{{if}\mspace{14mu}{{l_{n}\mspace{14mu}\ldots\mspace{14mu} l_{m}}}} = 0} \\ {{predstep}\left( {m,l_{m},\phi} \right)} & {{{if}\mspace{14mu} n} = m} \\ {{predstep}\left( {m,l_{m},{\phi\left\langle {l_{n}\mspace{14mu}\ldots\mspace{14mu} l_{m - 1}} \right\rangle}} \right)} & {otherwise} \end{matrix} \right.$

Definition 23

For Seq s and finite word l_(n) . . . l_(m) such that SI(v)=n

${s\left\langle {l_{n\mspace{14mu}}\ldots\mspace{14mu} l_{m}} \right\rangle} = \left\{ \begin{matrix} s & {{{if}\mspace{14mu}{{l_{n}\mspace{14mu}\ldots\mspace{14mu} l_{m}}}} = 0} \\ {{seqstep}\left( {m,l_{m},s} \right)} & {{{if}\mspace{14mu} n} = m} \\ {{seqstep}\left( {m,l_{m},{s\left\langle {l_{n}\mspace{14mu}\ldots\mspace{14mu} l_{m - 1}} \right\rangle}} \right)} & {otherwise} \end{matrix} \right.$

Abstraction of Letters and Words

Definition 24

If U

Σ is a set of signal names and

T,F

a letter, let abstractl(U,

T,F

)=

T∩U, F∩U

Definition 25

If u is a word and US is a cycle map, let abstractw(US,u)=u′ such that |u′|=|u|, SI(u)=SI(u′) and such that for each n<|u|, u′(SI(u)+n)=abstractl(US(SI(u)+n), u(SI(u)+n))

The ATD Function

The ATD function defines for each sequences s and each word w an abstraction of w. Below we will show that this function has the ATD property described above. (Let okp′(p)=ok where okp(p)=<ok,n>)

Definition 25 (atddef) Let ATD(u,p)=u′ where

ok, UP

=0kp(p<u>), u′=abstractw(UP,u).

Pred ATD Sufficiency and Minimality

Observation 1 If

-   -   u is a (full) finite word, and     -   not okp′(p         u         ), and     -   if ν         u, then okp′(p         ν         ), and     -   ATD(u,p)=u′, then     -   for any full νs.t. u′         ν, not okp′(p         ν         ), and     -   for any νs.t. ν         u′ there is full ν′ such that v         ν and okp′(p         ν         )

SUMMARY

The foregoing description of the embodiments of the invention has been presented for the purpose of illustration; it is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Persons skilled in the relevant art can appreciate that many modifications and variations are possible in light of the above disclosure.

Some portions of this description describe the embodiments of the invention in terms of algorithms and symbolic representations of operations on information. These algorithmic descriptions and representations are commonly used by those skilled in the data processing arts to convey the substance of their work effectively to others skilled in the art. These operations, while described functionally, computationally, or logically, are understood to be implemented by computer programs or equivalent electrical circuits, microcode, or the like. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules, without loss of generality. The described operations and their associated modules may be embodied in software, firmware, hardware, or any combinations thereof.

Any of the steps, operations, or processes described herein may be performed or implemented with one or more hardware or software modules, alone or in combination with other devices. In one embodiment, a software module is implemented with a computer program product comprising a computer-readable medium containing computer program code, which can be executed by a computer processor for performing any or all of the steps, operations, or processes described.

Embodiments of the invention may also relate to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, and/or it may comprise a general-purpose computing device selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a tangible computer readable storage medium or any type of media suitable for storing electronic instructions, and coupled to a computer system bus. Furthermore, any computing systems referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.

Embodiments of the invention may also relate to a computer data signal embodied in a carrier wave, where the computer data signal includes any embodiment of a computer program product or other data combination described herein. The computer data signal is a product that is presented in a tangible medium or carrier wave and modulated or otherwise encoded in the carrier wave, which is tangible, and transmitted according to any suitable transmission method.

Finally, the language used in the specification has been principally selected for readability and instructional purposes, and it may not have been selected to delineate or circumscribe the inventive subject matter. It is therefore intended that the scope of the invention be limited not by this detailed description, but rather by any claims that issue on an application based hereon. Accordingly, the disclosure of the embodiments of the invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims. 

1. A computer-implemented method for debugging counterexamples found in formal verification, the method comprising: receiving, by using a computer, a trace that illustrates a behavior of a circuit design that violates a property defined for the circuit design; selecting a set of explanatory points for the violated property, the explanatory points illustrating a portion of the trace of the counterexample that directly contributes to the violation of the property; and displaying the trace of the counterexample to the user; and displaying an indication of the explanatory points on the trace of the counterexample.
 2. The method of claim 1, wherein the trace is for a counterexample identified for the circuit design during a formal verification process.
 3. The method of claim 1, wherein the property is a covered property, and the trace is a cover trace comprising a counterexample to a negation of the covered property.
 4. The method of claim 1, wherein the set of explanatory points is both sufficient and minimal.
 5. The method of claim 1, wherein selecting a set of explanatory points for the violated property comprises: identifying a plurality of sets of explanatory points; and choosing one of the plurality sets of explanatory points that has the least difference between the earliest cycle and the failure point.
 6. The method of claim 1, wherein selecting a set of explanatory points for the violated property comprises: identifying a plurality of sets of explanatory points; and choosing one of the plurality sets of explanatory points that contains the least number of points.
 7. The method of claim 1, wherein the set of explanatory points includes at least one point that contributes to the triggering of the property and at least one point that contributes directly to the violation of the property.
 8. The method of claim 1, wherein displaying an indication of the explanatory points comprises displaying the points that contribute to the triggering of the property differently than the points that contribute directly to the violation of the property.
 9. The method of claim 8, wherein the points that contribute to the triggering of the property are displayed using a different color than the points that contribute directly to the violation of the property.
 10. The method of claim 1, wherein displaying an indication of the explanatory points comprises displaying inessential points.
 11. The method of claim 1, further comprising: receiving a user selection of a cycle, wherein displaying the trace of the counterexample is responsive to the selected cycle.
 12. The method of claim 1, further comprising: displaying source code of at least one of the property and the circuit design; receiving user selections to step through the source code view to display subsequent cycles of the trace; and displaying an indication of the explanatory points in the source code view.
 13. A computer program product for debugging counterexamples found in formal verification, the computer program product comprising a non-transitory computer-readable storage medium containing computer program code for: receiving a trace that illustrates a behavior of a circuit design that violates a property defined for the circuit design; selecting a set of explanatory points for the violated property, the explanatory points illustrating a portion of the trace of the counterexample that directly contributes to the violation of the property; and displaying the trace of the counterexample to the user; and displaying an indication of the explanatory points on the trace of the counterexample.
 14. The computer program product of claim 13, wherein the trace is for a counterexample identified for the circuit design during a formal verification process.
 15. The computer program product of claim 13, wherein the property is a covered property, and the trace is a cover trace comprising a counterexample to a negation of the covered property.
 16. The computer program product of claim 13, wherein the set of explanatory points is both sufficient and minimal.
 17. The computer program product of claim 13, wherein selecting a set of explanatory points for the violated property comprises: identifying a plurality of sets of explanatory points; and choosing one of the plurality sets of explanatory points that has the least difference between the earliest cycle and the failure point.
 18. The computer program product of claim 13, wherein selecting a set of explanatory points for the violated property comprises: identifying a plurality of sets of explanatory points; and choosing one of the plurality sets of explanatory points that contains the least number of points.
 19. The computer program product of claim 13, wherein the set of explanatory points includes at least one point that contributes to the triggering of the property and at least one point that contributes directly to the violation of the property.
 20. The computer program product of claim 13, wherein displaying an indication of the explanatory points comprises displaying the points that contribute to the triggering of the property differently than the points that contribute directly to the violation of the property.
 21. The computer program product of claim 20, wherein the points that contribute to the triggering of the property are displayed using a different color than the points that contribute directly to the violation of the property.
 22. The computer program product of claim 13, wherein displaying an indication of the explanatory points comprises displaying inessential points.
 23. The computer program product of claim 13, further comprising: receiving a user selection of a cycle, wherein displaying the trace of the counterexample is responsive to the selected cycle.
 24. The computer program product of claim 13, further comprising: displaying source code of at least one of the property and the circuit design; receiving user selections to step through the source code view to display subsequent cycles of the trace; and displaying an indication of the explanatory points in the source code view.
 25. The method of claim 1, wherein the explanatory points comprise one or more signal-cycle points of the trace of the counterexample that contribute directly to the violation of the property. 